<?php
    require_once '../../model/global.inc.php'; 
    $id = $_POST['file'];
    $sql = "select * from tblbidhistory where pro_id ='$id' order by bid_id desc limit 0,1";
    $result = mysql_query($sql);
    $row = mysql_fetch_array($result);
    $soldfor = $row['bid_price'];
    $memid = $row['memid'];
    $bidsused = $_POST['total'];
    $success = true;  
    $userTools = new UserTools();  
    if($success)  
        {  
            //prep the data for saving in a new user object  
            $data['memid'] = $memid;  
            $data['pro_id'] = $id; //encrypt the password for storage  
            $data['soldfor'] = $soldfor;                       
            $data['bid_used'] = $bidsused;

            //create the new user object  
            $pro = new Pro($data);  

            //save the new user to the database  
            $pro->completeBid();     

        }  
?>